package com.fick.tools;

import java.util.Iterator;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class SystemLogger {
	private static Log log = LogFactory.getLog(SystemLogger.class);

	/***************************************************************************
	 * 系统日志
	 **************************************************************************/
	public static boolean operatelog(HttpServletRequest request, String content) {
		log.warn("===============================================");
		log.warn("系统日志暂时输出:" + content);
		log.warn("===============================================");
		return true;
	}

	/***************************************************************************
	 * 错误日志
	 **************************************************************************/
	public static boolean errorlog(String errorCode, String errorName, String Msg) {
		log.error("===============================================");
		log.error("错误日志输出:");
		log.error("错误代码:" + errorName);
		log.error("错误名称:" + errorName);
		log.error("错误消息:" + Msg);
		log.error("===============================================");
		return true;
	}

	public static void printStringArray(String[] str) {
		for (int i = 0; i < str.length; i++) {
			log.warn(str[i]);
		}
	}

	public static void printList(List<Object> list) {
		Iterator<Object> it = list.iterator();
		while (it.hasNext()) {
			log.warn(it.next());
		}
	}

}